<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<body class="gray-bg">
<div class="ui-layout-west">
    <div class="main-content">
        <div class="box box-main" style="width: 3000px">
            <div class="box-header">
                <div class="box-title">
                    <i class="fa icon-grid"></i> 终端列表
                </div>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;">
                        <i class="fa fa-chevron-up"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠">
                        <i class="fa fa-chevron-down"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新">
                        <i class="fa fa-refresh"></i></button>
                </div>
            </div>
            <div class="ui-layout-content">
                <div id="tree" class="ztree" style="overflow: auto"></div>
            </div>
        </div>
    </div>
</div>
<div class="container-div ui-layout-center">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            编号：<input type="text" name="pid"/>
                        </li>
                        <li>
                            存放编号查询：<input type="text" id="uid" name="uid"/>
                        </li>
                        <!--<li>
                            设备地址：<input type="text" name="address"/>
                        </li>
                        <li>
                            运行状态：
                       <select name="statue" th:with="type=${@dict.getType('sys_normal_disable')}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </li>
                        <li>
                            广播内容：<input type="text" name="details"/>
                        </li>
                        <li>
                            <input class="laydate-icon  layer-date"
                                        name="runtime"
                                        id="runtime"
                                        value=""
                                        readonly="readonly"
                                        style="width:120px;"
                                        placeholder="运行时间"
                                        title="运行时间"/>
                        </li>-->

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
            <a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:phone:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:phone:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:phone:import">
                <i class="fa fa-upload"></i> 导入
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:phone:export">
                <i class="fa fa-download"></i> 导出
            </a>
            <!--<a class="btn btn-success" onclick="$.operate.exportExcelBySingle()" shiro:hasPermission="system:user:add">
                <i class="fa fa-plus"></i> 导出-->
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:phone:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:phone:remove')}]];
    var prefix = ctx + "system/phonemanage";
    var aid1 = "";
    $(function() {
        $('body').layout({ west__size: 185 });
        queryAreaList();
        queryAreaTree();
    });
    function queryAreaList() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            //exportBySingleUrl: prefix + "/exportbysingle",
            sortName: "pid",
            modalName: "广播终端",
            search: false,
            showExport: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'pid',
                    title: '编号'
                },
                {
                    field: 'phone',
                    title: '授权号码',
                    sortable: true
                },
                {
                    field: 'uid',
                    title: '用户ID'
                },
                {
                    field: 'uname',
                    title: '用户姓名'
                },
                {
                    field: 'rolecode',
                    title: '邮箱',
                    visible: false
                },
                {
                    field: 'allowid',
                    title: '批准编号'
                },
                {
                    field: 'allowname',
                    title: '批准人姓名',
                    sortable: true
                },
                {
                    field: 'reallowid',
                    title: '再次批准编号',
                    sortable: true
                },
                {
                    field: 'reallowname',
                    title: '再次批准人姓名',
                    sortable: true
                }]
        };
        $.table.init(options);
    };
    function queryAreaTree(){
        var url = ctx + "system/dept/treeData";
        var options = {
            url: url,
            onClick : zOnClick
        };
        $.tree.init(options);

        function zOnClick(event, treeId, treeNode) {
            //aid1 = treeNode.id;
            $("#uid").val(treeNode.id);
            $.table.search();
        }
        $.tree.init(options);
    }
    $('#form-group11').on('change', function (e) {
        $("#form-group1").attr("name",$("#form-group11").val())
    });
    $('#form-group22').on('change', function (e) {
        $("#form-group2").attr("name",$("#form-group22").val())
    });
    $('#form-group33').on('select2:select', function (e) {
        $("#form-group3").attr("name",$("#form-group33").val())
    });
    $('#form-group44').on('change', function (e) {
        $("#form-group4").attr("value",$("#form-group44").val());
    });
</script>
<script th:src="@{/js/plugins/layer/laydate/laydate.js}"></script>
<script th:src="@{/js/plugins/layer/layui-v2.4.5/layui/layui.js}"></script>
<script>
    laydate({
        elem:"#runtime",
        event:"focus"
    });
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem:"#phone",
            type: 'time',
        });
    });
</script>
</body>
</html>
<!--<!DOCTYPE html>-->
<!--<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">-->
<!--<head>-->
<!--    <th:block th:include="include :: header" />-->
<!--    <th:block th:include="include :: layout-latest-css" />-->
<!--    <th:block th:include="include :: ztree-css" />-->
<!--    &lt;!&ndash;	('授权手机列表')&ndash;&gt;-->
<!--</head>-->
<!--<link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>-->
<!--<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>-->
<!--<body class="gray-bg">-->
<!--<div class="ui-layout-west">-->
<!--    <div class="box box-main">-->
<!--        <div class="box-header">-->
<!--            <div class="box-title">-->
<!--                <i class="fa icon-grid"></i> 部门分布-->
<!--            </div>-->
<!--            <div class="box-tools pull-right">-->
<!--                <a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>-->
<!--                <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>-->
<!--                <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>-->
<!--                <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="ui-layout-content">-->
<!--            <div id="tree" class="ztree"></div>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->
<!--<div class="ui-layout-center">-->
<!--    <div class="container-div">-->
<!--        <div class="row">-->
<!--            <div class="col-sm-12 search-collapse">-->
<!--                <form id="user-form">-->
<!--                    <input type="hidden" id="pid" name="pid">-->
<!--                    <div class="select-list">-->
<!--                        <ul>-->
<!--                            <li>-->
<!--                                人员姓名：<input type="text" name="uname"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                授权号码：<input type="text" name="phone"/>-->
<!--                            </li>-->
<!--&lt;!&ndash;                            <li>&ndash;&gt;-->
<!--&lt;!&ndash;                                用户状态：<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">&ndash;&gt;-->
<!--&lt;!&ndash;                                <option value="">所有</option>&ndash;&gt;-->
<!--&lt;!&ndash;                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>&ndash;&gt;-->
<!--&lt;!&ndash;                            </select>&ndash;&gt;-->
<!--&lt;!&ndash;                            </li>&ndash;&gt;-->
<!--                            <li>-->
<!--                                批准人姓名：<input type="text" name="allowname"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                再次批准人姓名：<input type="text" name="reallowname"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
<!--                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
<!--                            </li>-->
<!--                        </ul>-->
<!--                    </div>-->
<!--                </form>-->
<!--            </div>-->

<!--            <div class="btn-group-sm" id="toolbar" role="group">-->
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:phone:add">-->
<!--                    <i class="fa fa-plus"></i> 新增-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:phone:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:phone:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
<!--                <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:phone:import">-->
<!--                    <i class="fa fa-upload"></i> 导入-->
<!--                </a>-->
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:phone:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
<!--            </div>-->

<!--            <div class="col-sm-12 select-table table-striped">-->
<!--                <table id="bootstrap-table"></table>-->
<!--            </div>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->

<!--<th:block th:include="include :: footer" />-->
<!--<th:block th:include="include :: layout-latest-js" />-->
<!--<th:block th:include="include :: ztree-js" />-->
<!--<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>-->
<!--<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>-->
<!--<script th:inline="javascript">-->
<!--    var editFlag = [[${@permission.hasPermi('system:phone:edit')}]];-->
<!--    var removeFlag = [[${@permission.hasPermi('system:phone:remove')}]];-->
<!--    var prefix = ctx + "system/phonemanage";-->
<!--    $(function() {-->
<!--    var panehHidden = false;-->
<!--    if ($(this).width() < 769) {-->
<!--        panehHidden = true;-->
<!--    }-->
<!--    $('body').layout({ initClosed: panehHidden, west__size: 185 });-->
<!--    queryPhoneList();-->
<!--    queryDeptTree();-->
<!--    });-->
<!--    function queryPhoneList() {-->
<!--        var options = {-->
<!--            url: prefix + "/list",-->
<!--            createUrl: prefix + "/add",-->
<!--            updateUrl: prefix + "/edit/{id}",-->
<!--            removeUrl: prefix + "/remove",-->
<!--            exportUrl: prefix + "/export",-->
<!--            importUrl: prefix + "/importData",-->
<!--            importTemplateUrl: prefix + "/importTemplate",-->
<!--            // sortName: "createTime",-->
<!--            sortOrder: "desc",-->
<!--            modalName: "用户",-->
<!--            columns: [{-->
<!--                checkbox: true-->
<!--            },-->
<!--                {-->
<!--                    field: 'pid',-->
<!--                    title: '编号'-->
<!--                },-->
<!--                {-->
<!--                    field: 'phone',-->
<!--                    title: '授权号码',-->
<!--                    sortable: true-->
<!--                },-->
<!--                {-->
<!--                    field: 'uid',-->
<!--                    title: '用户ID'-->
<!--                },-->
<!--                {-->
<!--                    field: 'uname',-->
<!--                    title: '用户姓名'-->
<!--                },-->
<!--                {-->
<!--                    field: 'rolecode',-->
<!--                    title: '邮箱',-->
<!--                    visible: false-->
<!--                },-->
<!--                {-->
<!--                    field: 'allowid',-->
<!--                    title: '批准编号'-->
<!--                },-->
<!--                {-->
<!--                    field: 'allowname',-->
<!--                    title: '批准人姓名',-->
<!--                    sortable: true-->
<!--                },-->
<!--                {-->
<!--                    field: 'reallowid',-->
<!--                    title: '再次批准编号',-->
<!--                    sortable: true-->
<!--                },-->
<!--                {-->
<!--                    field: 'reallowname',-->
<!--                    title: '再次批准人姓名',-->
<!--                    sortable: true-->
<!--                }]-->
<!--        };-->
<!--        $.table.init(options);-->
<!--    }-->
<!--    function queryDeptTree()-->
<!--    {-->
<!--        var url = ctx + "system/dept/treeData";-->
<!--        var options = {-->
<!--            url: url,-->
<!--            expandLevel: 2,-->
<!--            onClick : zOnClick-->
<!--        };-->
<!--        $.tree.init(options);-->

<!--        function zOnClick(event, treeId, treeNode) {-->
<!--            // $("#deptId").val(treeNode.id);-->
<!--            // $("#parentId").val(treeNode.pId);-->
<!--            $("#uid").val(treeNode.id);-->
<!--            $.table.search();-->
<!--        }-->
<!--    }-->

<!--    /* 用户管理-部门 */-->
<!--    function dept() {-->
<!--        var url = ctx + "system/dept";-->
<!--        $.modal.open("部门管理", url);-->
<!--    }-->

<!--    // $('#btnExpand').click(function() {-->
<!--    //     $._tree.expandAll(true);-->
<!--    //     $(this).hide();-->
<!--    //     $('#btnCollapse').show();-->
<!--    // });-->
<!--    //-->
<!--    // $('#btnCollapse').click(function() {-->
<!--    //     $._tree.expandAll(false);-->
<!--    //     $(this).hide();-->
<!--    //     $('#btnExpand').show();-->
<!--    // });-->
<!--    //-->
<!--    // $('#btnRefresh').click(function() {-->
<!--    //     queryDeptTree();-->
<!--    // });-->
<!--</script>-->
<!--</body>-->
<!--</html>-->